home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Encarta World Atlas 1999 / Encarta World 99 Install Disk.iso / evg / Flights / SoundsDe.js < prev    next >
Encoding:
JavaScript  |  1998-09-01  |  3.7 KB  |  92 lines

  1. /*****************************************************************************
  2.  SoundsDe.js
  3.  
  4.  Encarta Virtual Globe 1999
  5.  
  6.  (c) Copyright Microsoft Corporation 1998
  7.  
  8.  Fly Through has site specific sounds/music. This include file contains 
  9.  the declerations for the data used by the functions which return which
  10.  index to use in the media source nodes of the media graph. It is assumed
  11.  that the data tables here are in sync with the MediaGraph control nodes,
  12.  that contain the paths to the proper music. If one changes, make sure the
  13.  other does as well. The media graph can be altered using AudioMan's
  14.  MediaAuthor and the Sounds.mgd file. Cut and paste the control specification
  15.  in to the TerrainCtl.htm file.
  16.  
  17.  This file is to be included by Flights.htm 
  18.  
  19.  Owner = WHsu
  20. *****************************************************************************/
  21. // Here we decide which sound to play next. The way Stan Lepard would like things
  22. // to cycle is as such: Fusion, Wind, Radio/Site Sound, Wind, repeat
  23.  
  24. var g_fSoundsEnabled = false;
  25. var g_fSoundsActive = false;
  26.  
  27. var g_PlayList = new Array(4);
  28. var g_PlayIndex = 0;
  29. g_PlayList[0] = "PlayFusion()";
  30. g_PlayList[1] = "PlayWind()";
  31. g_PlayList[2] = "PlaySiteSound()";
  32. g_PlayList[3] = "PlayWind()";
  33.  
  34. /* For debugging purposes only....
  35. var g_PlayList = new Array(2);
  36. var g_PlayIndex = 0;
  37. g_PlayList[0] = "PlayWind()";
  38. g_PlayList[1] = "PlaySiteSound()";
  39. var G_DEBUG_PLAY_COUNT=0;
  40. */
  41.  
  42. var g_fRadioSoundReady = false;
  43. var g_fSiteSoundReady  = false;
  44.  
  45. // Set Sound Table for all sounds over all continents
  46. // Some of this structure is a vestiage of how things were originally set
  47. // up when there was a single html file for all the continents. Now that
  48. // there is a separate file for each continent some of the extra
  49. // dimensions aren't needed, but they aren't hurting so leave well
  50. // enough along.
  51. var g_SoundTable = new Array(6);    // 3D array, [continent][site][lat/long/sound index]
  52.  
  53. var g_Continent=1;              // index to first dim of g_SoundTable
  54. var g_Continent_Num = 6;        // 6 entries
  55. var g_Continent_Names = new Array(g_Continent_Num);
  56. var g_Continent_NA = 0;
  57. var g_Continent_SA = 1;
  58. var g_Continent_EU = 2;
  59. var g_Continent_AS = 3;
  60. var g_Continent_AF = 4;
  61. var g_Continent_AU = 5;
  62.  
  63. g_Continent_Names[g_Continent_NA] = "NA";    // North America
  64. g_Continent_Names[g_Continent_SA] = "SA";    // South America
  65. g_Continent_Names[g_Continent_EU] = "EU";    // Europe
  66. g_Continent_Names[g_Continent_AS] = "AS";    // Asia
  67. g_Continent_Names[g_Continent_AF] = "AF";    // Africa
  68. g_Continent_Names[g_Continent_AU] = "AU";    // Austrialia
  69.  
  70. var g_SiteSounds = "SiteSoundsXX";            // one of the continent names will be appended to match media graph node name
  71. var g_SiteSoundsNode;                        // node object corresponding to g_SiteSounds
  72. var g_RadioSoundsNode;                        // node object for Radio collection
  73. var g_WindSoundNode;                        // node object for Wind URLWav
  74. var g_fFusionSrcAllLoaded = false;          // Since the number of fusion nodes vary, other global fusion variables declared in SoundsXX.js
  75.  
  76. // 
  77. // Range is the "radio range of the ship", the distance that site specific 
  78. // sounds can be picked up. Array should match up with g_Continent_Names
  79. // units are in Lat, Long squared. See FindNearestSound.
  80. var g_Range = new Array(6);
  81. g_Range[g_Continent_NA] = 35; // A GUESS !!
  82. g_Range[g_Continent_SA] = 25; // A GUESS !!
  83. g_Range[g_Continent_EU] = 25; // A GUESS !!
  84. g_Range[g_Continent_AS] = 35; // A GUESS !!
  85. g_Range[g_Continent_AF] = 30; // A GUESS !!
  86. g_Range[g_Continent_AU] = 30; // A GUESS !!
  87.  
  88. var g_indexLat = 0;         // index to third dim of g_SoundTable
  89. var g_indexLong = 1;
  90. var g_indexSound = 2;            // NOTE: if we continue using index numbers, then we can do without this field
  91.  
  92.